<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head th:replace="common/head"></head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
    <th:block th:replace="common/header"></th:block>
    <th:block th:replace="common/nav"></th:block>

    <div class="content-wrapper">
        <section class="content-header">
            <h1>
                系统管理
                <small>字典管理新增/修改</small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="/index"><i class="fa fa-dashboard"></i> 首页</a></li>
                <li><a href="#">字典管理</a></li>
                <th th:if="${xsDictionaryDto.mode==0}">
                <li><a href="#">字典添加</a></li>
                </th>
                <th th:if="${xsDictionaryDto.mode==1}">
                <li><a href="#">字典编辑</a></li>
                </th>
                <!--<th th:if="${xsDictionaryDto.mode==2}">-->
                <!--<li><a href="#">字典查看</a></li>-->
                <!--</th>-->
            </ol>
        </section>

        <section class="content">
            <div class="row">
                <div class="col-xs-12">
                    <div class="box box-info">
                        <div class="box-header with-border">
                            <th th:if="${xsDictionaryDto.mode==0}">
                            <h3 class="box-title">字典信息添加</h3>
                            </th>
                            <th th:if="${xsDictionaryDto.mode==1}">
                            <h3 class="box-title">字典信息编辑</h3>
                            </th>
                            <!--<th th:if="${xsDictionaryDto.mode==2}">-->
                            <!--<h3 class="box-title">字典信息查看</h3>-->
                            <!--</th>-->
                        </div>
                        <!-- /.box-header -->
                        <!-- form start -->
                        <form class="form-horizontal" action="/xsDictionary/operate" method="post" >
                            <input type="hidden" name="id" th:value="${xsDictionaryDto.id}">
                            <input type="hidden" name="mode" th:value="${xsDictionaryDto.mode}">
                            <div class="box-body">
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">所属类别</label>
                                    <div class="col-sm-4">
                                        <select required="required" name="type" id="type" class="form-control" >
                                            <option value="">-请选择-</option>
                                            <option value="0">-创建新类型-</option>
                                            <th:block th:each="type, i:${xsDictionaryDto.DictionaryType}">
                                                <option th:value="${type.id}" th:text="${type.name}" th:selected="${type.id==xsDictionaryDto.type}"></option>
                                            </th:block>
                                        </select>
                                    </div>
                                    <div class="col-sm-3">
                                        <input type="text" name="typeName" id="typeName" class="form-control" placeholder="大于2个字符">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">字典值</label>
                                    <div class="col-sm-4">
                                        <input type="text" class="form-control" id="value" name="value" th:value="${xsDictionaryDto.value}" placeholder="字典值"  autocomplete="off" />
                                    </div>
                                </div>

                            </div>
                            <!-- /.box-body -->
                            <div class="box-footer">
                                <th th:if="${xsDictionaryDto.mode==0}">
                                <a href="list" class="btn btn-default">取 消</a>
                                <button  type="submit" class="btn btn-info pull-right submit">提 交</button>
                                </th>
                                <th th:if="${xsDictionaryDto.mode==1}">
                                <a href="list" class="btn btn-default">取 消</a>
                                <button type="submit" class="btn btn-info pull-right submit">提 交</button>
                                </th>
                                <!--<th th:if="${xsDictionaryDto.mode==2}">-->
                                <!--<a href="list" class="btn btn-default">取 消</a>-->
                                <!--<a href="list" class="btn btn-info pull-right">返 回</a>-->
                                <!--</th>-->
                            </div>
                            <!-- /.box-footer -->
                        </form>
                    </div>

                    <!-- /.box -->
                </div>
            </div>
            <!-- /.row -->
        </section>
    </div>

    <th:block th:replace="common/footer"></th:block>
</div>

<th:block th:replace="common/script"></th:block>
</body>
</html>
